package com.adnaan.backend.common.event;

import lombok.Getter;
import org.springframework.context.ApplicationEvent;

@Getter
public class BaseEvent extends ApplicationEvent {
    private final Long businessId;
    private final Long userId;
    private final EventType eventType;
    private final Object data;

    /**
     * @param source     事件源
     * @param businessId 业务ID
     * @param userId     推送用户ID
     * @param eventType  事件类型
     */
    public BaseEvent(Object source, Long businessId, Long userId, EventType eventType) {
        this(source, businessId, userId, eventType, null);
    }

    /**
     * @param source     事件源
     * @param businessId 业务ID
     * @param userId     推送用户ID
     * @param eventType  事件类型
     * @param data       事件数据
     */
    public BaseEvent(Object source, Long businessId, Long userId, EventType eventType, Object data) {
        super(source);
        this.businessId = businessId;
        this.userId = userId;
        this.eventType = eventType;
        this.data = data;
    }
} 